package com.example.demo.contorller;

import com.example.demo.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("hello")
public class AjaxContorller {
    @RequestMapping("findAllStudents")
    @ResponseBody
    public List<Student> findAllStudents(){
        List<Student> list = new ArrayList<>();
        list.add(new Student("小红","管理"));
        list.add(new Student("小白","会计"));
        list.add(new Student("小黑","计算机"));
        list.add(new Student("张三","软件工程"));
        list.add(new Student("赵四","土木工程"));
        return list;
    }
}
